libobs_simple\sources\linux\sources/
x11_capture.rs1use libobs_wrapper::{data::StringEnum, sources::ObsSourceRef};
2
3use crate::sources::macro_helper::{define_object_manager, impl_default_builder};
4
5#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6pub enum ObsX11ServerType {
8 Local,
10 Custom,
12}
13
14impl StringEnum for ObsX11ServerType {
15 fn to_str(&self) -> &str {
16 match self {
17 ObsX11ServerType::Local => "local",
18 ObsX11ServerType::Custom => "custom",
19 }
20 }
21}
22
23define_object_manager!(
24 #[derive(Debug)]
25 struct X11CaptureSource("xshm_input", *mut libobs::obs_source) for ObsSourceRef {
30 #[obs_property(type_t = "int")]
32 screen: i64,
33
34 #[obs_property(type_t = "bool")]
36 show_cursor: bool,
37
38 #[obs_property(type_t = "bool")]
40 advanced: bool,
41
42 #[obs_property(type_t = "string")]
44 server: String,
45
46 #[obs_property(type_t = "int")]
48 cut_top: i64,
49
50 #[obs_property(type_t = "int")]
52 cut_left: i64,
53
54 #[obs_property(type_t = "int")]
56 cut_right: i64,
57
58 #[obs_property(type_t = "int")]
60 cut_bot: i64,
61 }
62);
63
64impl_default_builder!(X11CaptureSourceBuilder);